from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route


async def hello(request):
    name = request.path_params["name"]
    return JSONResponse({"message": f"Hello, {name}", "code": 200})


routes = [
    Route("/hello/{name}", endpoint=hello, methods=["GET"])
]

app = Starlette(debug=True, routes=routes)
